const db = require('../../models/index');
const DAO = require('../../dao/sql-option-dao');
const Article = db.article;
const Likes = db.likes;
const Message = db.message;


exports.count = async (req, res) => {
    try {
        let articleCountAll = await Article.count();
        let likesCountAll = await Likes.count();
        let messageCountAll = await Message.count();
        console.log(articleCountAll)
        console.log(likesCountAll)
        console.log(messageCountAll)
        let data = {
            'articleCount': articleCountAll,
            'likesCount': likesCountAll,
            'messageCount': messageCountAll,
        };
        res.sendResultAto(data, 200, '查询成功');
    } catch (e) {
        console.log(e);
        logger.error(e);
        res.sendResultAto(null, 500, '服务器错误，请联系管理员！');
    }
}
